using Assets.Scripts.SO;
using UnityEngine;

namespace Assets.Scripts.Entities
{
    internal class JumpStation : MonoBehaviour
    {
        [SerializeField] private ScriptableUpgrade _heightUpgrade;
        [SerializeField] private Transform _basePlatfrom;
        [SerializeField] private Transform _jumpPlatform;
        [SerializeField] private LineRenderer _line;

        public void UpdateState()
        {
            var offset = Vector3.forward;

            _jumpPlatform.position = _basePlatfrom.position + new Vector3(0, _heightUpgrade.Value, 0);

            _line.SetPosition(0, _basePlatfrom.position + offset);
            _line.SetPosition(1, _jumpPlatform.position + offset);
        }

        private void Start()
        {
            UpdateState();
        }
    }
}
